//
//  DeviceCell.m
//  doubleEduStudents
//
//  Created by 盛洋 on 2021/1/8.
//  Copyright © 2021 shengYang. All rights reserved.
//

#import "DeviceCell.h"

@implementation DeviceCell

- (void)awakeFromNib {
    [super awakeFromNib];
    _device_lab.font = AutoLabFont2;
    _deviceNum_lab.font = _current_lab.font =  _deleate_btn.titleLabel.font = AutoLabFont3;
    [self.contentView insertSubview:self.back_img atIndex:0];
    [self.deleate_btn addTarget:self action:@selector(delegateDevice:) forControlEvents:UIControlEventTouchUpInside];
}

-(void)setModel:(DeviceModel *)model{
    _model = model;
    _device_lab.text = [NSString stringWithFormat:@"%@",model.deviceName];
    _deviceNum_lab.text = [NSString stringWithFormat:@"设备号：%@",model.deviceId];
}


-(void)delegateDevice:(UIButton *)sender{
    if ([self.delegate respondsToSelector:@selector(delegateDevice:)]) {
        [self.delegate delegateDevice:sender];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
